package util

func IndexOf[T int | string | float64 | struct{}](arr []T, val T, n int) int {
	for i := 0; i < n; i++ {
		if arr[i] == val {
			return i
		}
	}
	return -1
}
